
<nav id="navmenu1" class="navbar navbar-inverse " role="navigation">
    <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">{{ config.APP_NAME }}</a>      
    </div>

    <div class="collapse navbar-collapse" id="bs-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class=""><a href="{{ url_for('home') }}"><i  class="navmenuicon hidden-xs showopacity glyphicon glyphicon-home"></i>Home</a></li>
        {% if menus %}
      {% for menu in menus %}
          {% if menu.type==0  %}
            {% if menu.childrens %}
              <li class="dropdown {{ menu.active }}">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span  class="navmenuicon hidden-xs showopacity glyphicon glyphicon-{{ menu.icon }}"></span>{{ menu.name }}<span class="caret"></span></a>
          <ul class="dropdown-menu forAnimate" role="menu">
            {% for item in menu.childrens %}
              <li><a href="{{ item.link }}"><span class="navmenuicon hidden-xs showopacity glyphicon glyphicon-{{ item.icon }}"></span>{{  item.name }}</a></li>
              <li class="divider"></li>
            {% endfor %}
          </ul>
          </li>

            {% else %}
              <li class="{{ menu.active }}"><a href="{{ menu.link }}"><span class="navmenuicon hidden-xs showopacity glyphicon glyphicon-{{ menu.icon }}"></span>{{ menu.name }}</a></li>  
            {% endif %}
        {% endif %}
      {% endfor %}
    {% endif %}
    {% if current_user.is_authenticated %}
      <li class="dropdown">
          <a href="" class="dropdown-toggle" data-toggle="dropdown"><span  class="navmenuicon hidden-xs showopacity glyphicon glyphicon-user"></span>{{ current_user.username or current_user.email  }}<span class="caret"></span></a>
          <ul class="dropdown-menu forAnimate" role="menu">
              <li><a href="{{ url_for('home') }}"><span class="navmenuicon hidden-xs showopacity glyphicon glyphicon-edit"></span>编辑本页</a></li>
              <li><a href="{{ url_for('admin.manage') }}"><span class="navmenuicon hidden-xs showopacity glyphicon glyphicon-cog"></span>管理</a></li>
              <li><a href="{{ url_for('home') }}"><span class="navmenuicon hidden-xs showopacity glyphicon glyphicon-refresh"></span>更新个人信息</a></li>
               <li class="divider"></li>
              <li><a href="{{ url_for('admin.imageIndex') }}"><span class="navmenuicon hidden-xs showopacity glyphicon glyphicon-picture"></span>多媒体管理</a></li>
              <li><a href="{{ url_for_security('logout') }}"><span class="navmenuicon hidden-xs showopacity glyphicon glyphicon-log-out"></span>登出</a></li>
          </ul>
          </li>
    {% else %}
       <li><a href="{{ url_for_security('login') }}"><span class="navmenuicon hidden-xs showopacity glyphicon glyphicon-user"></span>登录</a></li>  
    {% endif %}

      </ul>
      <form id="searchForm" class="navbar-form navbar-right" action="{{ url_for('pages.searchDef') }}" role="search">
        <div class="form-group">
          <input name="keyword" type="text" class="form-control" placeholder="Search">
        </div>
        <button id="searchBtn" type="button" class="btn btn-info">搜索</button>
      </form>
    </div>
  </div>
</nav>
